package com.ubi.core.database.pagination;

/**
 * mysql方言类
 */
public class MySqlDialect extends Dialect {

    /*
     * (non-Javadoc)
     * 
     * @see
     * org.mybatis.extend.interceptor.IDialect#getLimitString(java.lang.String,
     * int, int)
     */
    @Override
    public String getLimitString(String sql, int offset, int limit) {
        StringBuilder pagingSqlBuilder = new StringBuilder();

        pagingSqlBuilder.append(sql);

        pagingSqlBuilder.append(" limit ");

        pagingSqlBuilder.append(offset);

        pagingSqlBuilder.append(", ");

        pagingSqlBuilder.append(limit);
        return pagingSqlBuilder.toString();
    }

}
